package secu;

import java.util.function.Consumer;

import org.apache.commons.codec.digest.DigestUtils;

/**
 * commons-codec下的DigestUtils
 * @author ben
 * @date 2021-09-26 22:55:28 CST
 */
public class TestDigestUtils {

	public static Consumer<Object> cs = System.out::println;

	public static void main(String[] args) {
		test1();
	}

	/**
	 * DigestUtils
	 * @author ben
	 * @date 2021-09-26 22:58:33 CST
	 */
	public static void test1() {
		cs.accept("test1()...start");
		String data = "abc";
		cs.accept("data=" + data);
		
		String md5 = DigestUtils.md5Hex(data);
		cs.accept("md5=" + md5);
		
		String sha1 = DigestUtils.sha1Hex(data);
		cs.accept("sha1=" + sha1);
		
		String sha512 = DigestUtils.sha512Hex(data);
		cs.accept("sha512=" + sha512);
	}
	
}
